package com.vhall.component.entity.tag.enums;

import com.vhall.component.entity.dictionary.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author shimingming
 * @since 2023/8/9 10:20
 */
@Getter
@AllArgsConstructor
public enum AdverShelvesEnum implements BaseEnum {

    NOT_LISTED(0, "未上架"),
    LISTED(1, "已上架"),
    REMOVED_FROM_SHELVES(2, "已下架"),
    ;

    private Integer value;

    private String name;

    public static String getName(Integer value) {
        for (AdverShelvesEnum template : AdverShelvesEnum.values()) {
            if (template.getValue().equals(value)) {
                return template.name;
            }
        }
        return null;
    }

    public static AdverShelvesEnum parse(Integer value) {
        for (AdverShelvesEnum type : AdverShelvesEnum.values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return null;
    }

}
